<template>
  <view class="mine_top">
    <!-- 个人信息 -->
    <view class="mine_top_1" @click="navTo('mine/information')">
      <view class="mine_top_left">
        <image :src="userInfo.avatar"></image>
        <view class="add_Nmae">
          <view style="display: flex; align-items: flex-end; justify-content: flex-start">
            <text>{{ userInfo.nickname }}</text>
            <!-- <text style="margin-left: 10rpx; color: white; font-size: 30rpx" v-if="userInfo.role_text">
              ({{ userInfo.role_text }})
            </text> -->
          </view>
          <text v-if="userInfo.mobile" class="phone">{{ userInfo.mobile }}</text>
          <!-- @click="navTo('order/integral')" -->
          <!-- <text v-if="userInfo.score" class="phone" @click="navTo('order/integral')">积分:{{ userInfo.score }}</text> -->
          <text v-if="!userInfo.mobile" class="buttum" @click.stop="emit('toBindPhone')">未绑定</text>
        </view>
      </view>
      <view class="mine_top_right"><uni-icons type="right" color="#fff" size="26"></uni-icons></view>
    </view>
    <!-- 账户信息 -->
    <view class="mine_pay">
      <view class="space-between texts">
        <text>我的钱包</text>
        <!-- #ifdef H5 -->
        <text v-if="userInfo.is_plug!=0" @click="redirectTo('Sale/index/index')">地推端</text>
        <!-- #endif -->
      </view>
      <view class="text_List">
        <view class="mine_pay_1" style="border-right: 1px solid #eee;box-sizing: border-box;">
          <view @click="navTo('account/account')">个人账户(元)<uni-icons type="forward" size="12"></uni-icons></view>
          <view>
            <text @click="navTo('account/account')">{{ userInfo.money }}</text>
          </view>
          <view @click.stop="navTo('mine/Recharge')">去充值>></view>
        </view>
        <view class="mine_pay_1" style="border-right: 1px solid #eee;box-sizing: border-box;"
          @click="navTo('fenbo/fenboList')" v-if="userInfo.fenbo_money!=0">
          <view>分拨账户(元)<uni-icons type="forward" size="12"></uni-icons></view>
          <view>
            <text>{{ userInfo.fenbo_money }}</text>
          </view>
        </view>
        <view class="mine_pay_1" @click="navTo('authorized/available')">
          <view class="">老板账户(元)<uni-icons type="forward" size="12"></uni-icons></view>
          <view>
            <text>{{ userInfo.empower_money }}</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup lang="ts">
  import { useUserStore } from '@/stores/user';
  import { navTo, redirectTo } from '@/utils/navigator';
  import { isH5 } from '@/utils/platform';
  // view
  const userInfo = useUserStore();
  // data
  const emit = defineEmits(['toBindPhone']);
</script>

<style scoped lang="less">
  @import url('../mine/less/mine_top.less');
</style>